#include <iostream>
#include <string.h>

using namespace std;
int main() {
	string a;
	cin >> a;
	int count[10];
	memset(count, 0, sizeof(count));
	int len = a.length();
	int i;
	for (i = 0; i < len; i++) {
		if (a[i] < '0' || a[i]>'9')
			cout << a[i];
		else {
			switch (a[i]) {
			case '0':cout << "(Zero)"; count[0]++; break;
			case '1':cout << "(One)"; count[1]++; break;
			case '2':cout << "(Two)"; count[2]++; break;
			case '3':cout << "(Three)"; count[3]++; break;
			case '4':cout << "(Four)"; count[4]++; break;
			case '5':cout << "(Five)"; count[5]++; break;
			case '6':cout << "(Six)"; count[6]++; break;
			case '7':cout << "(Seven)"; count[7]++; break;
			case '8':cout << "(Eight)"; count[8]++; break;
			case '9':cout << "(Nine)"; count[9]++; break;
			}
		}
	}
	cout << endl;
	for (i = 0; i < 10; i++)
		cout << count[i] << " ";
	system("pause");
	return 0;
}